﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="EstimatePromotion.aspx.cs" Inherits="EstimatePromotion" %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
    <style type="text/css">
        .style1
        {
            text-decoration: underline;
        }
        .style6
        {
            color: #0033CC;
            font-size: x-large;
        }
    </style>
    </asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
    <span class="style6"><strong>Recommend your promotion
    </strong></span><br />
&nbsp;&nbsp;<table cellpadding="1" cellspacing="3" style="width:95%">
    <tr>
        <td style="width:200px">
              <img alt="" src="images/ais.png" style="height: 48px; width: 138px"  /></td>
        <td style="width:200px">
               <img alt="" src="images/dtac.png" style="height: 58px; width: 106px" /></td>
        <td style="width:200px">
                <img alt="" src="images/tmove.png" style="height: 20px; width: 135px"  /></td>
        <td style="width:200px; padding-left: 20px;" rowspan="4" valign="top">
            <br />
            <strong>Payment<br />
            </strong>
            <br />
            <asp:RadioButton ID="rdoPrepaid" runat="server" GroupName="groupPayment" />
            <asp:Image ID="Image1" runat="server" AlternateText="Prepaid" 
                ImageAlign="Middle" ImageUrl="~/images/prepaid.png" />
            <br />
            <asp:RadioButton ID="rdoPostpaid" runat="server" GroupName="groupPayment" />
            <asp:Image ID="Image2" runat="server" AlternateText="Postpaid" 
                ImageAlign="Middle" ImageUrl="~/images/postpaid.png" />
            <br />
            <asp:RadioButton ID="rdoBothPaid" runat="server" GroupName="groupPayment" 
                Text="Both" />
        </td>
     </tr>
     <tr style="vertical-align:top" >
        <td>
            <asp:Panel ID="pnlAis" runat="server">
            </asp:Panel>
         </td>
        <td>
            <asp:Panel ID="pnlDtac" runat="server">
            </asp:Panel>
        </td>
        <td>
            <asp:Panel ID="pnlTmove" runat="server">
            </asp:Panel>
        </td>
     </tr>
     <tr style="vertical-align:top">
        <td bgcolor="#EEEEEE">
            <asp:CheckBox ID="chkAis" runat="server" Text="AIS" CssClass="bold" />
        </td>
        <td bgcolor="#EEEEEE">
            <asp:CheckBox ID="chkDtac" runat="server" Text="DTAC" CssClass="bold" />
        </td>
        <td bgcolor="#EEEEEE">
            <asp:CheckBox ID="chkTmove" runat="server" Text="truemove" CssClass="bold" />
        </td>
     </tr>
     <tr style="vertical-align:top">
        <td>
            <asp:LinkButton ID="LinkButton1" runat="server" 
                onclientclick="a = document.getElementById('aisfriends'); if(a.style.display=='block') { a.style.display='none'; this.innerText='Show'; }else { a.style.display='block'; this.innerText='Hide'; } return false;">Show</asp:LinkButton>&nbsp  top numbers
            of AIS<br />
            <div id="aisfriends" style="display:none" >
                <asp:CheckBoxList ID="chkTopAis" runat="server">
                </asp:CheckBoxList>
            </div>
        </td>
        <td>
            <asp:LinkButton ID="LinkButton2" runat="server"
                onclientclick="a = document.getElementById('dtacfriends'); if(a.style.display=='block') { a.style.display='none'; this.innerText='Show'; }else { a.style.display='block'; this.innerText='Hide'; } return false;">Show</asp:LinkButton>&nbsp  top numbers of DTAC
            <div id="dtacfriends" style="display:none" >
                <asp:CheckBoxList ID="chkTopDtac" runat="server">
                </asp:CheckBoxList>
            </div>
            </td>
        <td>
            <asp:LinkButton ID="LinkButton3" runat="server"
               onclientclick="a = document.getElementById('tmovefriends'); if(a.style.display=='block') { a.style.display='none'; this.innerText='Show'; }else { a.style.display='block'; this.innerText='Hide'; } return false;" >Show</asp:LinkButton>&nbsp  top numbers of truemove
            <div id="tmovefriends" style="display:none" >
                <asp:CheckBoxList ID="chkTopTmove" runat="server">
                </asp:CheckBoxList>
            </div>
            </td>
     </tr>
  </table>
  <br />
    <asp:Panel ID="Panel1" runat="server" BorderColor="White" BorderWidth="4px" 
        BackColor="#F6F6F6">
        <asp:LinkButton ID="LinkButton4" runat="server" 
                
    
            onclientclick="a = document.getElementById('otherinput'); if(a.style.display=='block') { a.style.display='none'; this.innerText='Show'; }else { a.style.display='block'; this.innerText='Hide'; } return false;">Show</asp:LinkButton>
        &nbsp; more input for SMS, MMS and Internet.<div id="otherinput" 
            style="padding: 20px; display:none" >
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
                    <table style="width: 96%">
                        <tr>
                            <td style="width: 10%; vertical-align: top;">
                                <strong>SMS</strong><br />
                                <br />
                                <strong>MMS</strong>
                            </td>
                            <td style="width: 35%; vertical-align: top;">
                                <asp:TextBox ID="txtSms" runat="server"></asp:TextBox>
                                &nbsp;times/month<br />&nbsp;<br /><asp:TextBox ID="txtMms" runat="server" 
                                    style="margin-right: 1px"></asp:TextBox>
                                &nbsp;times/month</td>
                            <td style="width: 10%; vertical-align: top;">
                                <strong>Internet</strong>
                            </td>
                            <td style="width: 45%; vertical-align: top;">
                                <table width="99%">
                                    <tr>
                                        <td style="width: 10px; vertical-align: top;">
                                            <asp:RadioButton ID="rdoInternetNone" runat="server" 
                                                GroupName="internetgroup" />
                                        </td>
                                        <td style="vertical-align: top">
                                            <strong>None</strong></td>
                                    </tr>
                                    <tr>
                                        <td style="width: 10px; vertical-align: top;">
                                            <asp:RadioButton ID="rdoInternet0" runat="server" GroupName="internetgroup" />
                                        </td>
                                        <td style="vertical-align: top">
                                            <strong>Small<br /> </strong>Browseing web sometimes
                                            <br />
                                            (20 hours/month)</td>
                                    </tr>
                                    <tr>
                                        <td style="vertical-align: top;">
                                            <asp:RadioButton ID="rdoInternet1" runat="server" GroupName="internetgroup" />
                                        </td>
                                        <td style="vertical-align: top">
                                            <strong>Medium<br /> </strong>Browseing web and checking email
                                            <br />
                                            (200 MB/month)</td>
                                    </tr>
                                    <tr>
                                        <td style="vertical-align: top;">
                                            <asp:RadioButton ID="rdoInternet2" runat="server" GroupName="internetgroup" />
                                        </td>
                                        <td style="vertical-align: top">
                                            <strong>Large<br /> </strong>Using full feature of smartphone
                                            <br />
                                            (500 MB/month)</td>
                                    </tr>
                                    <tr>
                                        <td style="vertical-align: top;">
                                            <asp:RadioButton ID="rdoInternet3" runat="server" GroupName="internetgroup" />
                                        </td>
                                        <td style="vertical-align: top">
                                            <strong>Unlimited<br /> </strong>Using internet all time</td>
                                    </tr>
                                    <tr>
                                        <td style="vertical-align: top;">
                                            <asp:RadioButton ID="rdoInternet4" runat="server" GroupName="internetgroup" />
                                        </td>
                                        <td style="vertical-align: top">
                                            <strong>Name your prefered time<br /> </strong>
                                            <asp:TextBox ID="txtNetHour" runat="server"></asp:TextBox>
                                            &nbsp;hours/day</td>
                                    </tr>
                                    <tr>
                                        <td style="vertical-align: top;">
                                            <asp:RadioButton ID="rdoInternet5" runat="server" GroupName="internetgroup" />
                                        </td>
                                        <td style="vertical-align: top">
                                            <strong>Name your prefered volume</strong><br />
                                            <asp:TextBox ID="txtNetMb" runat="server"></asp:TextBox>
                                            &nbsp;MB/day</td>
                                    </tr>
                                    <tr>
                                        <td>
                                        </td>
                                        <td>
                                        </td>
                                        <tr>
                                            <td class="style1" style="vertical-align: top;">
                                                Note</td>
                                            <td style="vertical-align: top">
                                                Assume that I use internet about&nbsp;<br />
                                                <asp:TextBox ID="txtMbPerHour" runat="server"></asp:TextBox>
                                                &nbsp;MB/hour</td>
                                        </tr>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>
                </ContentTemplate>
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="btnEstimate" EventName="Click" />
                </Triggers>
            </asp:UpdatePanel>
&nbsp;</div>
    </asp:Panel>
    <br />
    <asp:Button ID="btnEstimate" runat="server" onclick="btnEstimate_Click" 
        Text="Recommend Promotions" Font-Bold="True" Width="232px" />
    <br />
    <asp:UpdateProgress ID="UpdateProgress1" runat="server" 
        AssociatedUpdatePanelID="updProCalc">
        <ProgressTemplate>
            Loading ...
        </ProgressTemplate>
    </asp:UpdateProgress>
    <br />
    <asp:UpdatePanel ID="updProCalc" runat="server">
        <ContentTemplate>
            <asp:GridView ID="grdPromotion" runat="server" AutoGenerateColumns="False" 
        CellPadding="4" ForeColor="#333333" GridLines="None" Width="97%" 
    RowStyle-VerticalAlign=Top>
                <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                <Columns>
                    <asp:TemplateField HeaderText="" HeaderStyle-Width="1%" >
                        <ItemTemplate>
                            &nbsp&nbsp<asp:Label ID="lblRunningNumber" ForeColor="#CCCCCC"  Text='<%# Bind("Number") %>' runat="server" Font-Bold="True"></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Provider" HeaderStyle-Width="10%">
                        <ItemTemplate>
                            <asp:Image ID="imgProvider" runat="server" AlternateText='<%# Eval("Provider") %>'
                        ImageUrl='<%# "images/small/"+ Eval("Provider") + ".png" %>' />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="" HeaderStyle-Width="12%">
                        <ItemTemplate>
                            <asp:Label ID="lblProType" Text='<%# Bind("ProType") %>' runat="server" Visible=false></asp:Label>
                            <br />
                            <asp:Image ID="imgPayment" runat="server" Width="80px" AlternateText='<%# Bind("ProType") %>' ToolTip='<%# Bind("ProType") %>'
                        ImageUrl='<%# "images/"+ Eval("ProType") + ".png" %>' />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Promotion" HeaderStyle-Width="50%">
                        <ItemTemplate>
                            <asp:Label ID="lblName" Text='<%# Bind("Name") %>' runat="server" 
                        Font-Bold="True"></asp:Label>
                            <br />
                            <asp:Label ID="lblDescription" Text='<%# Bind("Description") %>' runat="server"></asp:Label>
                            <br />
                            <br />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="" HeaderStyle-Width="2%">
                        <ItemTemplate>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Price" HeaderStyle-Width="15%">
                        <ItemTemplate>
                            

                            <table width="100%" cellpadding=0 cellspacing=0>
                                <tr>
                                    <td style="width:50%; color:Gray;">Voice</td>
                                    <td style="width:50%; text-align:right"><asp:Label ID="lblVoicePrice" Text='<%# Bind("VoicePrice") %>' runat="server"></asp:Label></td>
                                </tr>
                                <tr>
                                    <td style="color:Gray;">SMS</td>
                                    <td style="text-align:right"><asp:Label ID="lblSmsPrice" Text='<%# Bind("SmsPrice") %>' runat="server"></asp:Label></td>
                                </tr>
                                <tr>
                                    <td style="color:Gray;">MMS</td>
                                    <td style="text-align:right"><asp:Label ID="lblMmsPrice" Text='<%# Bind("MmsPrice") %>' runat="server"></asp:Label></td>
                                </tr>
                                <tr>
                                    <td style="color:Gray;">Internet</td>
                                    <td style="text-align:right"><asp:Label ID="lblNetPrice" Text='<%# Bind("NetPrice") %>' runat="server"></asp:Label></td>
                                </tr>
                            </table>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="inc 7% Vat" HeaderStyle-Width="10%"  HeaderStyle-HorizontalAlign="Right"  ItemStyle-HorizontalAlign="Right">
                        <ItemTemplate>
                            <asp:Label ID="lblPricePlusVat" Text='<%# Bind("PriceVat") %>' runat="server" Font-Bold="True"></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
                <EditRowStyle BackColor="#999999" />
                <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                <SortedAscendingCellStyle BackColor="#E9E7E2" />
                <SortedAscendingHeaderStyle BackColor="#506C8C" />
                <SortedDescendingCellStyle BackColor="#FFFDF8" />
                <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
            </asp:GridView>

             <asp:LinkButton ID="btnGetAllPromotions" runat="server" 
                onclick="btnGetAllPromotions_Click">See more promotions ...</asp:LinkButton>
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="btnEstimate" EventName="Click" />
        </Triggers>
    </asp:UpdatePanel>
   
  <br />
</asp:Content>

